<%@ page contentType="text/html; charset=iso-8859-1" language='java' errorPage='erro.jsp' %>
<%@ page pageEncoding="UTF-8"%>
<%@ include file="../WEB-INF/jspf/cabecalho.jspf" %>
<%@ include file="../WEB-INF/jspf/acesso.jspf" %>
<%@ include file="../WEB-INF/jspf/setMeta.jspf" %>

<sql:query var='rsetReg' dataSource='${con}'>    
    SELECT * FROM Usuario     
    WHERE idUsuario = '<c:out value="${param.chv1}"/>'
</sql:query>


<form name="form1" method="post" action="../controller/editarUsuario.jsp">
  <fieldset>
  <legend><font color="#0000FF"><strong>Editar Dados do Usu&aacute;rio</strong></font></legend>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <div align="center"> 
    <table width="32%" >
      <tr> 
        <td><strong>C&oacute;digo:</strong></td>
        <td colspan="3"><input name="idUsuario" type="text" id="idUsuario" value="${param.chv1}" size="10" readonly="" /></td>
      </tr>
      <tr> 
        <td><strong>Nome:<font color="#FF0000">*</font></strong></td>
        <td colspan="3"><input name="nome" type="text" id="nome" value="<c:out value="${rsetReg.rowsByIndex[0][1]}"/>" size="50"  /></td>
      </tr>
      <tr> 
        <td><strong>Perfil:<font color="#FF0000">*</font></strong></td>
        <td colspan="3"><select name="perfil" id="perfil" >
            <option>Gerente de Atendimento</option>
            <option selected><c:out value="${rsetReg.rowsByIndex[0][2]}"/></option>
            <option>Gerente de Unidade Gerencial</option>
            <option>Técnico</option>
          </select></td>
      </tr>
      <tr> 
        <td><strong>Usuário:<font color="#FF0000">*</font></strong></td>
        <td colspan="3"><input name="usuario" type="text" id="usuario" value="<c:out value="${rsetReg.rowsByIndex[0][3]}"/>" /></td>
      </tr>
       <tr> 
        <td><strong>Equipe:<font color="#FF0000">*</font></strong></td>
        <td colspan="3"><select name="equipe" id="equipe">
            <option selected="selected"><c:out value="${rsetReg.rowsByIndex[0][4]}"/></option>
            <option>UGTEC</option>
            <option>UGSAC</option>
            <option>UGLOG</option>
            <option>UGRCM</option>
            <option>UGPDO</option>
            <option>UGPES</option>
          </select></td>
      </tr>
      <tr> 
          <td><strong>Senha:<font color="#FF0000">*</font></strong></td>
          <td colspan="3"><input name="senha" type="password" id="senha" value="" /></td>
      </tr>
      <tr> 
        <td><strong>Status:<font color="#FF0000">*</font></strong></td>
        <td colspan="3"><select name="statusUsuario">
            <option >Ativo</option>
            <option >Inativo</option>
            <option selected="selected"><c:out value="${rsetReg.rowsByIndex[0][7]}"/></option>
          </select></td>
      </tr>
      <tr> 
        <td height="21">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"> <div align="right"> </div></td>
        <td><div align="center"> 
            <input type="button" name="cancelar" value="Cancelar" onclick="javascript:history.go(-1);"  />
          </div></td>
        <td> <div align="center"> 
            <input type="reset" name="limpar" value="Limpar" onclick=""/>
          </div></td>
        <td> <div align="center"> 
            <input type="submit" name="enviar" value="Enviar" onclick="javascript:verifica();"/>
          </div></td>
      </tr>
    </table>
  </div>  
  
  <script language="javascript">
  function verifica(){
  
  // Atenção(Por wldutra): implementar aqui a verificação dos campos para validar
  
  document.form1.submit();
  
  }
  </script>
  <p>&nbsp;</p>
  <p>&nbsp; </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  </fieldset>
</form>

</body>
</html>
